<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        #uu>li {
            background-color: yellow;
            float: left;
            margin-right: 10px;
            width: 100px;
            height: 100px;
            list-style-type: none;
        }
    </style>
    <script src="jquery-3.3.1.min.js"></script>
    <script>
        $(function(){
            // 遍历所有li 
            $("#uu>li").each(function(index,ele){
                var opacity = (index+1)/10;
                console.log(opacity);
                $(ele).css("opacity",opacity);
            });
        });
    </script>
</head>
<body>
    <ul id="uu">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
        <li>7</li>
        <li>8</li>
        <li>9</li>
        <li>10</li>
    </ul>
    
</body>
</html>